package de.graph.common.impl;

import java.util.HashSet;

import de.graph.common.Edge;
import de.graph.common.Graph;
import de.graph.common.Vertex;
import de.graph.document.Document;
import de.graph.document.impl.DocumentFactory;

public final class GraphFactory {
	
    protected static final String GRAPH_TYPE = "graphType";
    protected static final String EDGE_SET   = "edgeSet";
    protected static final String VERTEX_SET = "vertexSet";

    public enum GraphType {
        DIRECTED,
        UNDIRECTED;
    }

	private GraphFactory() {
	}

	public static final Graph create(GraphType type) {
	    
        Document graphDocument = DocumentFactory.create();
        
        graphDocument.setProperty(GRAPH_TYPE, type);
        graphDocument.setProperty(VERTEX_SET, new HashSet<Vertex>());
        graphDocument.setProperty(EDGE_SET,   new HashSet<Edge>());
        
		return new GraphImpl(graphDocument);
	}
}
